/*
 * 
 *方法的整理与重构
 *
 *
 */

//定义app参数名称，并加载其它模块
var authApp=angular.module('authapp', ["ngCookies",'ngFileUpload','ui.bootstrap']);

//此为定位页面所用

/*controller部分*/


//定义父controller，主要用于controller之间传递信息
authApp.controller("fcontroller",function($scope,$http){
	//
	//****与分页相关的****
	//
	
	//从接口中获取总的分页数量
	$scope.$on('$getPageCountFromApi',function(event,data){
		$scope.$broadcast('$getPageCount',data);
	});
	
	//捕获分页点击事件并传递currentPage信息到主controller
	 $scope.$on('$pageAction',function(event,data){
		 $scope.$broadcast('$pageChanged',data);
	 });
})

//主要操作controller
authApp.controller("statisticontroller",function($scope,$http,Upload,$timeout,$sce){
	//**********主体方法
	//设置分页初始参数（最好与$scope.currentPage和$scope.itemsPerPage一致！！！！//这边之所以$scope.pageNumber=0是因为后台接口第一页为0）
	$scope.isxq=false;
	$scope.isxx=true;
	$scope.iszx=true;
	
	$scope.queryMajor = function(){
		if($scope.major==""){
			$scope.isxq=false;
			$scope.isxx=true;
			$scope.iszx=true;
		}else if($scope.major=="1"){
			$scope.isxq=true;
			$scope.isxx=false;
			$scope.iszx=true;
		}else if($scope.major=="2"){
			$scope.isxq=true;
			$scope.isxx=true;
			$scope.iszx=false;
		}
	}
	
	/*下面为自已编辑部分*/
	
	//调用主接口成功之后的处理方法
	
	/*
	 * 
	 * 其它操作方法
	 * 
	 */
	
	
	$scope.turnTo=function(pid){
		location.href="meterial_apply_sl.html?pid="+pid;
	}
	
	$scope.download1=function(major){
		if(window.confirm("是否确定下载 ？")){
			location.href="/authentication/exportExcel/exportSchoolRunning?major="+major;
		}
	}
	$scope.download2=function(major){
		if(window.confirm("是否确定下载 ？")){
			location.href="/authentication/schoolData/exportAuthStudent?major="+major;
		}
	}
	$scope.download3=function(major){
		if(window.confirm("是否确定下载 ？")){
			location.href="/authentication/schoolData/exportAuthTeacher?major="+major;
		}
	}
	$scope.download4=function(major){
		if(window.confirm("是否确定下载 ？")){
			location.href="/authentication/schoolData/exportAuthResource?major="+major;
		}
	}
	$scope.download5=function(major){
		if(window.confirm("是否确定下载 ？")){
			location.href="/authentication/schoolData/exportAuthTeacherResource?major="+major;
		}
	}
	$scope.download6=function(major){
		if(window.confirm("是否确定下载 ？")){
			location.href="/authentication/schoolData/exportAuthMoney?major="+major;
		}
	}
	$scope.download7=function(major){
		if(window.confirm("是否确定下载 ？")){
			location.href="/authentication/schoolData/exportAuthItemData?major="+major;
		}
	}
	$scope.download8=function(major){
		if(window.confirm("是否确定下载 ？")){
			location.href="/authentication/schoolData/exportInspectionCollect?major="+major;
		}
	}
})






